<?php
/**
 * 公共控制器
 * @author yupoxiong<i@yufuping.com>
 */

namespace app\admin\controller;
use app\common\model\Goods;
use app\common\model\GoodsCategory;
use app\admin\logic\{CommonLogic,GoodsCategoryLogic};
use tools\SystemInfo;
use think\Request;
use think\Db;

class CommonController extends Controller
{
    
    public function selectGoods(){
        if ($this->request->isAjax()){
            $get = $this->request->get();
            $goods_list = CommonLogic::getGoodsList($get,true);
            return json([
                'code' =>1,
                'msg'  =>'',
                'data' =>$goods_list,
            ]);
        }
        $category_list = GoodsCategoryLogic::categoryTreeeTree();
        $this->assign('category_list', $category_list);
        return $this->fetch();
    }
}
